function $class(classname) {
	return document.getElementsByClassName(classname);
}
// 封装id
function $id(idname) {
	return document.getElementById(idname);
}

// 模拟jquery  css函数
function myCss(ele, csskey, cssValue) {
	if (cssValue != void 0) {
		ele.style[csskey] = cssValue;
	} else {
		// return window.getComputedStyle(ele, null)[csskey];
		return ele.currentStyle ? ele.currentStyle[csskey] : window.getComputedStyle(ele, null)[csskey] || 0;
	}
}

// 判断有没有这个类
function hasClass(el, className) {
	if (el && el.className !== void 0) {
		var classList = el.className.split(/\s+/);
		if (classList.indexOf(className) >= 0) {
			return true;
		} else return false;
	} else {
		return false;
	}
}

// 删除这个类
function deleteClass(el, className) {
	if (hasClass(el, className)) {
		var classList = el.className.split(/\s+/);
		var deleteIndex = classList.indexOf(className);
		classList.splice(deleteIndex, 1);
		el.className = classList.join(' ');
	} else {
		return;
	}
}

// 添加这个类
function addClass(el, className) {
	if (hasClass(el, className)) {
		return false;
	} else {
		var classList = el.className.split(/\s+/);
		classList.push(className);
		el.className = classList.join(" ");
	}
}

function emptyClass(el) {
	if (el && el.className) {
		el.className = '';
	}
}

// 两个对象合并
function mixin(targetObj, originObj) {
	for (var i in originObj) {
		if (originObj[i] != void 0) {
			targetObj[i] = originObj[i];
		}
	}
	return targetObj;
}